import numpy as np
import matplotlib.pyplot as plt

from utils import set_chinese


# 反色变换函数
def image_log(input):
    return np.log(1 + input)


def main():
    input = np.array([[10, 150],
                      [250, 25500]])
    output = image_log(input)
    print(output)

    set_chinese()
    fig = plt.figure()
    ax1 = fig.add_subplot(121)
    ax1.set_title('对数变换前')
    ax1.imshow(input, cmap='gray', vmin=0, vmax=25500)

    ax2 = fig.add_subplot(122)
    ax2.set_title('对数变换后')
    ax2.imshow(output, cmap='gray')

    plt.show()



if __name__ == '__main__':
    main()